package 字符串.easy;

import java.util.Arrays;

/**
 * @author Lw中
 * @date 2020/8/13 10:34
 */
public class WuWuQi {

    public static String reverseWords(String s) {
        // 截取字符串的子串方法
        String[] str = s.split(" ");
        String str1 = null;
        String res = "";
        for (int i = 0; i < str.length; i++) {
            // 将子字符串反转
            str1 = new StringBuffer(str[i]).reverse().toString();
            res += str1 + " ";
        }
        return res.trim();
    }

    public static void main(String[] args) {
        String s = reverseWords("hehhhhhhe lwz");
        System.out.println(s);
    }

}
